document.addEventListener("DOMContentLoaded", function () {
  // 工资计算器
  const salaryInput = document.querySelector(".calculator input");
  const calculateBtn = document.querySelector(".calculator .btn");
  const resultDiv = document.querySelector(".calculator .result");

  calculateBtn.addEventListener("click", function () {
    const salary = parseFloat(salaryInput.value);
    if (salary && salary > 0) {
      // 工资计算逻辑：假设简单扣除税率为20%
      const taxRate = 0.2;
      const afterTaxSalary = (salary * (1 - taxRate)).toFixed(2);

      // 显示计算结果
      resultDiv.textContent = `税后工资为：${afterTaxSalary} 元`;
    } else {
      resultDiv.textContent = ""; // 清除上一次结果
      alert("请输入有效的工资金额");
    }
  });

  // 感兴趣和立即沟通按钮
  const interestBtn = document.querySelector(".btn-outline");
  // const contactBtn = document.querySelector(".btn-primary");

  interestBtn?.addEventListener("click", function () {
    this.style.background = "#00b38a";
    this.style.color = "white";
  });
});
